/* test_map.cpp */

#include <iostream>

#include <dodo_plot/dodo_plot.h>
#include <dodo_plot/map/lambert.h>
#include <dodo_plot/map/map.h>
#include <dodo_plot/map/map_grid.h>

using namespace std;
using namespace dodo_plot;
using namespace dodo_plot::color_name;

int main()
{
	Point top_left(-120, 36);
	Point bottom_right(-80, 10);
	Lambert proj(16, 30, -104, 24, top_left, bottom_right);
	Map_Data states_data("mexico/states.shp");
	Map_Data rivers_data("mexico/rivers.shp");
	Map_Data lakes_data("mexico/lakes.shp");
	Map_Data roads_data("mexico/roads.shp");

	Map<Lambert> states_map(states_data, proj);
	Map<Lambert> rivers_map(rivers_data, proj);
	Map<Lambert> lakes_map(lakes_data, proj);
	Map<Lambert> roads_map(roads_data, proj);

//	Map<Lambert> map(map_data, proj);
	states_map.set_fill_color(Color(0.95, 0.85, 0.6));
	rivers_map.set_line_color(BLUE);
	rivers_map.set_line_width(1.2);
	lakes_map.set_line_width(0.8);
	lakes_map.set_line_color(BLUE);
	lakes_map.set_fill_color(Color(0.2, 0.5, 0.9));
	roads_map.set_line_color(Color(0.5, 0.5, 0.5));
	roads_map.set_line_width(1.5);

	Map_Grid<Lambert> grid(proj, 
		8, 8,
		-120, -80,
		10, 36,
		-96, 12);
		
	Picture final = states_map + rivers_map + lakes_map + roads_map + grid;

	Canvas canvas(800, 600);
//		map.width(), map.height());
	canvas.draw(final);
	canvas.write_png("mexico.png");

	return 0;
}
